package com.example.basicdemo.model.builder;

import com.isyscore.os.dev.api.IsyscoreRequestBuilder;
import com.isyscore.os.dev.util.IsyscoreHashMap;
import com.isyscore.os.dev.util.RequestUtils;

import javax.servlet.http.HttpServletRequest;

public class SaveDataAuthRequestBuilder extends IsyscoreRequestBuilder {
    private IsyscoreHashMap headers;

    /**
     * 序号
     */
    private Integer id;

    /**
     * 数据角色名称
     */
    private String name;

    /**
     * 数据角色类型
     */
    private Integer type;

    /**
     * 数据角色状态
     */
    private Integer status;

    /**
     * 数据权限
     */
    private String acls;

    /**
     * 备注
     */
    private String remark;

    public Integer getId() {
        return id;
    }

    public SaveDataAuthRequestBuilder setId(Integer id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public SaveDataAuthRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public SaveDataAuthRequestBuilder setType(Integer type) {
        this.type = type;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public SaveDataAuthRequestBuilder setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public String getAcls() {
        return acls;
    }

    public SaveDataAuthRequestBuilder setAcls(String acls) {
        this.acls = acls;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public SaveDataAuthRequestBuilder setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public IsyscoreHashMap getHeaders() {
        return headers;
    }

    public SaveDataAuthRequestBuilder setHeaders(IsyscoreHashMap headers) {
        this.headers = headers;
        return this;
    }

    @Override
    public boolean validate() {
        return true;
    }

    @Override
    public IsyscoreRequestBuilder setRequestHeader(HttpServletRequest request) {
        this.headers = RequestUtils.getRequestHeader(request);
        return this;
    }
}
